	layui.use(['layer','form','element'],function(){
		
		 var layer = layui.layer;
		 var form = layui.form;
		 var $ = layui.$
		 var element = layui.element;
			
		//提交
		$("#submit").click(function(){
			 var username = $("#username").val();
			 var password = $("#password").val();
			 var data = {'username':username,'password':password}
			 $.ajax({
			 		url:'http://localhost:8888/admin/login',
			 		data:data,
			 		type:'post',
			 		async: false,
			 		success:function(data){
			 			sessionStorage.setItem("userKey",JSON.stringify(data))
			 			window.location.href = "student.html"
			 		},
			 		error:function(XMLHttpRequest){
			 			layer.msg("用户名或密码错误")
			 		}
			 	
			 })
		})
	})